Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: add get validated user fields view #253

Merged
merged 1 commit into from
Feb 26, 2025

Conversation

andrey-canon
Copy link
Collaborator

Description

Adds a new view that allows to get field validation base on REQUIRED_USER_FIELDS setting

Testing instructions

  1. First the REQUIRED_USER_FIELDS setting
REQUIRED_USER_FIELDS = {
    "account": {
        "first_name": {"max_length": 30, "char_type": "latin"},
        "last_name": {"max_length": 50, "char_type": "latin"},
    },
    "profile": {
        "city": {"max_length": 32, "char_type": "latin"},
        "country": {"max_length": 2, "optional_values": ["US", "CA", "MX", "BR"]},
        "phone_number": {"max_length": 15, "format": "phone"},
        "mailing_address": {"max_length": 40},
    },
    "extra_info": {
        "arabic_name": {"max_length": 20, "char_type": "arabic"},
        "arabic_first_name": {"max_length": 20, "char_type": "arabic"},
        "arabic_last_name": {"max_length": 50, "char_type": "arabic"},
    },
}
  1. Go to /eox-nelp/api/user-profile/v1/validated-fields/
  2. Go to the admin panel and change the user attributes, set an invalid value, then repeat previous step

image

@github-actions github-actions bot added test size/m m lines label labels Feb 25, 2025
Copy link
Collaborator

@johanseto johanseto left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM
image
image

@johanseto
Copy link
Collaborator

johanseto commented Feb 26, 2025

@andrey-canon I found like an error with phone_number if It doesnt start in +

Screencast.from.26-02-25.11.27.42.webm

@andrey-canon
Copy link
Collaborator Author

@andrey-canon I found like an error with phone_number if It doesnt start in +

Screencast.from.26-02-25.11.27.42.webm

Thanks for noticing. I will handle that case in the previous PR.

@johanseto
Copy link
Collaborator

@andrey-canon I found like an error with phone_number if It doesnt start in +
Screencast.from.26-02-25.11.27.42.webm

Thanks for noticing. I will handle that case in the previous PR.

Fix working.
image

Copy link
Collaborator

@johanseto johanseto left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Phone number issue already addressed in #250

Base automatically changed from and/add_user_fields_validation to master February 26, 2025 19:48
@andrey-canon andrey-canon force-pushed the and/add_validated_fields_view branch from 1e4201f to b64e124 Compare February 26, 2025 19:51
@andrey-canon andrey-canon merged commit 632f988 into master Feb 26, 2025
7 checks passed
@andrey-canon andrey-canon deleted the and/add_validated_fields_view branch February 26, 2025 19:55
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
size/m m lines label test
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants